// import React from 'react'
import ReactDom from 'react-dom'
import { createStore, applyMiddleware, compose } from 'redux'
import thunk from 'redux-thunk'
import { Provider } from 'react-redux'
import { BrowserRouter /*, Route, Routes*/ } from 'react-router-dom'
import reducers from './reducer'
// import 'antd-mobile/dist/antd-mobile.css'
// import Login from './container/login/login'
// import Register from './container/register/register'
// import AuthRoute from './component/authroute/authroute'
// import BossInfo from './container/bossinfo/bossinfo'
// import GeniusInfo from './container/geniusinfo/geniusinfo'
// import Dashboard from './component/dashboard/dashboard'
// import Chat from './component/chat/chat'
import App from './app'
import './config.js'
import './index.css'

const reduxDevtools = window.devToolsExtension ? window.devToolsExtension() : 
        window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__():() => {}
// const reduxDevtools = window.devToolsExtension ? window.devToolsExtension() : () => {}
let store
if(window.navigator.userAgent.includes('Chrome')) {
    store = createStore(reducers, compose(
        applyMiddleware(thunk)
        ,reduxDevtools
    ))
} else {
    store = createStore(reducers, compose(applyMiddleware(thunk)))
}

// let Boss = () => <h2>Boss ye</h2>
// function Dashboard(params) {
//     return <h2>Dashboard</h2>
// }

// function render() {
// boss, genius me, msg
    ReactDom.render(
        (<Provider store={store}>
            <BrowserRouter>
                <App></App>
                {/* <AuthRoute></AuthRoute>
                <Routes>
                    <Route path='/bossinfo' element={<BossInfo />}></Route>
                    <Route path='/geniusinfo' element={<GeniusInfo />}></Route>
                    <Route path='/login' element={<Login />}></Route>
                    <Route path='/register' element={<Register />}></Route>
                    <Route path='/chat/:user' element={<Chat />}></Route>
                    <Route exact path='*' element={<Dashboard />}></Route>
                </Routes> */}
            </BrowserRouter>
        </Provider>),
        document.getElementById('root')
    )

    if (module.hot) {
        module.hot.accept(() => {})
      }
// }
// render()
// store.subscribe(render)
